<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no">
		<title>个人中心</title>
		<link rel="stylesheet" href="/static/css/style.css" />

	</head>

	<body>
		<div class="center" id="center" v-cloak>
			<div class="avatar">
				<div class="left"><img :src="'/upload/weixin/avatar/'+user.user_id+'.png'" alt="" />${user.nickname} <i>${user.level}</i></div>
				<div class="right" @click="doAttend"><i class="icon icon-yijianfankui"></i>签到</div>
				<div class="clearfix"></div>
				<div class="h4">慧币余额</div>
				<a class="h1" href="/app/wxmp/user/bill"><span>${user.asset.amount}</span>元</a>
			</div>
			<ul class="total">
				<li>
					<a href="/app/wxmp/user/order">${user.asset.rebate}<br /><em>累计预估分红</em></a>
				</li>
				<li>
					<a href="/app/wxmp/user/team">${user.asset.team_count}人 <br /><em>团队成员</em></a>
				</li>
				<li>
					<a>${user.asset.score}<br /><em>积分</em></a>
				</li>
			</ul>
			<ul class="month">
				<li>
					<a>${user.this_balance_income}<br /><em>本月消费结算预估分红</em></a>
				</li>
				<li>
					<a>${user.last_balance_income} <br /><em>上月消费结算预估分红</em></a>
				</li>
				<li>
					<a>${user.this_income}<br /><em>本月消费预估分红</em></a>
				</li>
				<li>
					<a>${user.last_income}<br /><em>上月消费预估分红</em></a>
				</li>
				
			</ul>
			
		</div>

		<div class="container">
			<div class="list list-center">
				<div class="h2">功能</div>
<div class="list-grid">
				<!--<li>
					<a href="/app/wxmp/user/order" class="navigate-right"><i class="icon icon-dingdan"></i>我的订单</a>
				</li>

				<li>
					<a href="/app/wxmp/user/bill" class="navigate-right"><i class="icon icon-zhangdan"></i>我的对账单</a>
				</li>
				<li>
					<a href="/app/wxmp/user/team" class="navigate-right"><i class="icon icon-tuandui"></i>团队成员</a>
				</li>
				<li>
					<a href="/app/wxmp/user/message" class="navigate-right"><i class="icon icon-tishi"></i>提醒消息</a>
				</li>-->
				
				<li>
					<a href="/app/wxmp/user/order"><i class="icon icon-dingdan"></i>我的订单</a>
				</li>

				<li>
					<a href="/app/wxmp/user/bill"><i class="icon icon-zhangdan"></i>我的对账单</a>
				</li>
				<li>
					<a href="/app/wxmp/user/team"><i class="icon icon-tuandui"></i>团队成员</a>
				</li>
				<li>
					<a href="/app/wxmp/user/message"><i class="icon icon-tishi"></i>提醒消息</a>
				</li>
				
				<!--<div class="h2">操作</div>-->
<li>
					<a href="/app/wxmp/user/getcash"><i class="icon icon-tixian"></i>余额提现</a>
				</li>
				<li>
					<a href="/app/wxmp/user/bindOrder"><i class="icon icon-huo"></i>绑定订单</a>
				</li>
				<li>
					<a href="/app/wxmp/user/share"><i class="icon icon-saoyisao"></i>分享赚钱</a>
				</li>
				<li>
					<a href="/app/wxmp/user/help"><i class="icon icon-bangzhu"></i>查看帮助</a>
				</li>
				<!--<li>
					<a href="/app/wxmp/user/getcash" class="navigate-right"><i class="icon icon-tixian"></i>余额提现</a>
				</li>
				<li>
					<a href="/app/wxmp/user/bindOrder" class="navigate-right"><i class="icon icon-huo"></i>绑定订单</a>
				</li>
				<li>
					<a href="/app/wxmp/user/share" class="navigate-right"><i class="icon icon-saoyisao"></i>分享赚钱</a>
				</li>
				<li>
					<a href="/app/wxmp/user/share" class="navigate-right"><i class="icon icon-bangzhu"></i>查看帮助</a>
				</li>-->
				</div>
				<div class="h2">精选</div>
				
					
				
				<li>
					<a href="/app/wxmp/goods/index" class="navigate-right"><i class="icon icon-tehui"></i>淘宝特惠</a>
				</li>
				<li>
					<a href="/app/sales/index/brand" class="navigate-right"><i class="icon icon-jifenshangcheng"></i>品牌特卖</a>
				</li>
				
				

			</div>
		</div>

	</body>
	<script src="/static/js/mui.min.js"></script>
	<script src="/static/js/vue.min.js"></script>
	<script src="/static/js/zepto.min.js"></script>
	<script src="/static/js/plugins/popup.js"></script>
	<script src="/static/js/plugins/input.js"></script>
	<script type="text/javascript">
		var center = new Vue({
			el: '#center',
			delimiters: ['${', '}'],
			data: {
				user: {
					asset: {},
					user_id: ""
				}

			},
			mounted: function() {
				this.request();
			},

			methods: {

				request() {
					var self = this;

					$.post('/app/wxmp/user/index', {

					}, function(res) {
						if(res.errno == 0) {
							self.user = res.data;

						} else {
							popup.prompt(res.errmsg);
						}
					});

				},

				doAttend() {
					var self = this;

					$.post('/app/wxmp/user/attend', {

					}, function(res) {
						if(res.errno == 0) {
							self.user.asset.score++;
							popup.toast(res.data);

						} else {
							popup.prompt(res.errmsg);
						}
					});
				},

			}

		});
	</script>

</html>